← Back
Editing: index33.js
import{_ as e}from"./index93.js?v=1765440387";import{ay as a,a8 as t,K as s,c3 as i,o as l,c4 as o,l as n,L as r,c5 as m,u as c,aM as u,a6 as p,R as d}from"./utils-lib.js?v=1765440387";import{c as f,a as h,u as v}from"./column.js?v=1765440387";import{k as b,r as g,c as y,w as C,e as _,aR as N,aC as j,p as w,a5 as x,q as R,M as k,A as L,y as O,x as T}from"./base-lib.js?v=1765440387";import{b as B,N as W}from"./useMethods.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";import"./index94.js?v=1765440387";const{refs:{customLimit:q,isRefreshStorageList:A}}=a(),M=b({isRefresh:!0}),S=g([]),D=[{active:!0,label:"添加存储卷",onClick:()=>{n({component:()=>r(()=>import("./index217.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),title:"添加存储卷",area:58,btn:"添加"})}},{label:"清理存储卷",onClick:async()=>{await l({type:"calc",title:"清理存储卷",content:"您真的要清理所有未被容器使用的存储卷吗?(可能不会包含您自己创建的卷)"}),s({request:m(),message:!0,loading:"正在清理存储卷,请稍后...",success:()=>{A.value=!0}})}},{type:"link",label:"需求反馈",class:"ml-[2rem]",onClick:()=>{W()}}],E=async e=>{await l({type:"calc",title:"删除存储卷【".concat(e.Name,"】"),content:"您真的要删除存储卷【".concat(e.Name,"】吗?")}),s({request:o({data:JSON.stringify({name:e.Name})}),message:!0,success:()=>{A.value=!0}})},H=t([{label:"删除项目",value:"delete",event:async(e,a,t,s)=>{const{label:i,value:l}=s,n=async(e,a)=>{const{Name:t}=e;if("delete"===l)return await o({data:JSON.stringify({name:t})})};await e({title:"批量".concat(i,"存储卷"),content:"批量".concat(i,"已选的存储卷,是否继续操作!"),column:[{label:"存储卷",prop:"Name"},f()],onConfirm:async()=>(await a(n),A.value=!0,!1)})}}]),J=(e,a)=>{setTimeout(()=>{q.value.storage||((e,a)=>{setTimeout(()=>{e.value>900?a.value.limit=20:a.value.limit=10},0)})(e,a)},0)},P={class:"flex items-center"},I=y({__name:"index",setup(t){const{refs:{isRefreshStorageList:l}}=a(),{mainHeight:o}=c(),{BtOperation:n}=u({options:D});C(()=>l.value,e=>{e&&(M.isRefresh=!0,g())});const{BtTable:r,BtPage:m,BtBatch:f,BtColumn:b,refresh:g,param:y}=p({request:e=>(async e=>{if(A.value=!1,!M.isRefresh)return{data:B({limit:e.limit,list:S.value,p:e.p})||[],total:S.value.length};M.isRefresh=!1;const a=await s({request:i(),data:Array});return S.value=a,{data:B({limit:e.limit,list:S.value,p:e.p})||[],total:S.value.length}})(e),columns:[h({key:"Name"}),{label:"存储卷",prop:"Name",minWidth:100,render:e=>_(N,{placement:"top"},{default:()=>_("div",null,[e.Name]),content:()=>_("div",null,[e.Name])})},{label:"挂载点",prop:"Mountpoint",minWidth:100,isCustom:!0,showOverflowTooltip:!0},{label:"所属容器",prop:"container",minWidth:100,isCustom:!0},{label:"设备",prop:"Driver",minWidth:100,isCustom:!0},{label:"创建时间",prop:"CreatedAt",minWidth:100,isCustom:!0,render:e=>d(e.CreatedAt)},{label:"标签",prop:"Labels",minWidth:100,showOverflowTooltip:!0,isCustom:!0,render:e=>{if(!e.Labels)return j("span","");return(Object.entries(e.Labels)||[]).map(e=>"".concat(e[0],":").concat(e[1])).join(",")}},v([{onClick:E,title:"删除"}])],extension:[H]});return w(async()=>{J(o,y)}),x(()=>{M.isRefresh=!0,S.value=[]}),(a,t)=>{const s=e;return R(),k(s,{class:""},{"header-left":L(()=>[O("div",P,[_(T(n))])]),"header-right":L(()=>[_(T(b))]),content:L(()=>[_(T(r),{key:"storageTable","max-height":T(o)-220},null,8,["max-height"])]),"footer-left":L(()=>[_(T(f))]),"footer-right":L(()=>[_(T(m))]),popup:L(()=>[...t[0]||(t[0]=[])]),_:1})}}});export{I as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel